home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 June / PCWorld_2007-06_cd.bin / temacd / wikipad / WikidPad-1.9beta2.exe / {app} / extensions / EvalLibrary.py < prev    next >
Text File  |  2005-08-24  |  534b  |  26 lines

  1. from time import strftime
  2. import pwiki.urllib_red as urllib
  3.  
  4. def now():
  5.     return strftime("%x %I:%M %p")
  6.  
  7. def addDateTime(editor):
  8.     return editor.AddText(now())
  9.  
  10. def date():
  11.     return strftime("%x")
  12.  
  13. def addDate(editor):
  14.     return editor.AddText(date())
  15.  
  16. def time():
  17.     return strftime("%I:%M %p")
  18.  
  19. def addTime(editor):
  20.     return editor.AddText(time())
  21.  
  22. def encodeSelection(editor):
  23.     text = editor.GetSelectedText()
  24.     url = urllib.pathname2url(text)
  25.     editor.ReplaceSelection("file:%s" % url)
  26.